import 'package:flutter/material.dart';
import 'package:book_my_seat/book_my_seat.dart';
import 'package:flutter_svg/flutter_svg.dart';

//book_my_seat库
class MySeatPage extends StatefulWidget {
  const MySeatPage({super.key});

  @override
  State<MySeatPage> createState() => _MySeatPageState();
}

class _MySeatPageState extends State<MySeatPage> {
  Set<SeatNumber> selectedSeats = {};

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: _buildContent(),
      ),
    );
  }

  Widget _buildContent() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        const SizedBox(height: 16),
        const Text("Theatre Screen this side"),
        const SizedBox(height: 16),
        Flexible(
          child: SizedBox(
            width: double.maxFinite,
            height: 500,
            child: SeatLayoutWidget(
              onSeatStateChanged: (rowI, colI, seatState) {
                ScaffoldMessenger.of(context).hideCurrentSnackBar();
                ScaffoldMessenger.of(context).showSnackBar(
                  SnackBar(
                    content: seatState == SeatState.selected
                        ? Text("Selected Seat[$rowI][$colI]")
                        : Text("De-selected Seat[$rowI][$colI]"),
                  ),
                );
                if (seatState == SeatState.selected) {
                  selectedSeats.add(SeatNumber(rowI: rowI, colI: colI));
                } else {
                  selectedSeats.remove(SeatNumber(rowI: rowI, colI: colI));
                }
              },
              stateModel: const SeatLayoutStateModel(
                pathDisabledSeat: 'assets/svg_disabled_bus_seat.svg',
                pathSelectedSeat: 'assets/svg_selected_bus_seats.svg',
                pathSoldSeat: 'assets/svg_sold_bus_seat.svg',
                pathUnSelectedSeat: 'assets/svg_unselected_bus_seat.svg',
                rows: 23,
                cols: 33,
                seatSvgSize: 10,
                currentSeatsState: [
                  [
                    SeatState.sold,
                    SeatState.selected,
                    SeatState.empty,
                    SeatState.disabled,
                    SeatState.unselected,
                    SeatState.disabled,
                    SeatState.disabled,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.disabled,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.disabled,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                  ],
                  [
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                  ],
                  [
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.disabled,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.disabled,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                  ],
                  [
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                    SeatState.empty,
                  ],
                  [
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.unselected,
                    SeatState.sold,
                    SeatState.sold,
                  ],
                ],
              ),
            ),
          ),
        ),
        Padding(
          padding: const EdgeInsets.all(16.0),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  SvgPicture.asset(
                    'assets/svg_disabled_bus_seat.svg',
                    width: 15,
                    height: 15,
                  ),
                  const Text('Disabled')
                ],
              ),
              Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  SvgPicture.asset(
                    'assets/svg_sold_bus_seat.svg',
                    width: 15,
                    height: 15,
                  ),
                  const Text('Sold')
                ],
              ),
              Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  SvgPicture.asset(
                    'assets/svg_unselected_bus_seat.svg',
                    width: 15,
                    height: 15,
                  ),
                  const Text('Available')
                ],
              ),
              Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  SvgPicture.asset(
                    'assets/svg_selected_bus_seats.svg',
                    width: 15,
                    height: 15,
                  ),
                  const Text('Selected by you')
                ],
              ),
            ],
          ),
        ),
        const SizedBox(
          height: 12,
        ),
        ElevatedButton(
          onPressed: () {
            setState(() {});
          },
          child: const Text('Show my selected seat numbers'),
          style: ButtonStyle(
            backgroundColor: MaterialStateProperty.resolveWith(
                (states) => const Color(0xFFfc4c4e)),
          ),
        ),
        const SizedBox(height: 12),
        Text(selectedSeats.join(" , "))
      ],
    );
  }
}

class SeatNumber {
  final int rowI;
  final int colI;

  const SeatNumber({required this.rowI, required this.colI});

  @override
  bool operator ==(Object other) {
    return rowI == (other as SeatNumber).rowI &&
        colI == (other as SeatNumber).colI;
  }

  @override
  int get hashCode => rowI.hashCode;

  @override
  String toString() {
    return '[$rowI][$colI]';
  }
}
